# Contributor: Sodface <sod@sodface.com>
# Maintainer: Sodface <sod@sodface.com>
pkgname=althttpd
pkgver=202206041050
pkgrel=0
pkgdesc="Small, simple, stand-alone HTTP server"
url="https://sqlite.org/althttpd/doc/trunk/althttpd.md"
arch="all"
license="Public-Domain"
makedepends="openssl-dev"
options="!check" # no test suite
subpackages="$pkgname-doc $pkgname-openrc"
source="
	$pkgname-$pkgver.tar.gz::https://sqlite.org/althttpd/tarball?r=$pkgver
	10-allow-filename-plus-sign.patch
	$pkgname.confd
	$pkgname.initd
	"
builddir="$srcdir"

build() {
	make althttpsd
}

package() {
	install -Dm 644 "$srcdir"/althttpd.confd \
		"$pkgdir"/etc/conf.d/althttpd
	install -Dm 755 "$srcdir"/althttpd.initd \
		"$pkgdir"/etc/init.d/althttpd
	install -D althttpsd \
		"$pkgdir"/usr/bin/althttpd
	install -Dm644 althttpd.md \
		"$pkgdir"/usr/share/doc/$pkgname/althttpd.md
}

sha512sums="
56c6e9ad23d9b80f2d72ab36f5b7c3d2875c77057a3544b7d11c9bacf70e21f9801b6fdd48356415a09b60b4b32678dea39c31e2d7feb45cb3c333a578a4ecf1  althttpd-202206041050.tar.gz
f1b7e7be0ffe9ec15313fe70c5080cbc742917b594b410b2f3016a63ac46071d8d2cb3f071c4809b8076ea836ddd11c0197a2a216568611a66492ad01d76c929  10-allow-filename-plus-sign.patch
6ad8e0d3227773eda5f4d32dee8de8fd3aa590f32fb7b6f6fb13855b6576e5faa1578a1d363c0b846323a723998958fcef9c4c1359d23c183a750b07a00079cd  althttpd.confd
f21867430470b836d97d60215d9dda835125140cced3bb9c856349228572f2c73ac0574d3f705d72938879fc2b5a37855768a5f7de5c29943e3aa6ead5d72d9c  althttpd.initd
"
